<?php
class calendarWidget extends Widget {

	public function render(){
        // get params
        $action_id = doit::get_action_id();
        
        if ($action_id == 'archive') {
            $time_string = $this->get('id');
            $time_array = explode('-', $time_string);
            $year = (int)$time_array[0];
            $month = (int)$time_array[1];
            $calendar_html = calendar::show($year, $month);
            
        } else {
            
            $calendar_html = calendar::show();
        } 
        
        //display widget
        include $this->view();
	}
}